package com.zoshine.zzg.controller;

import com.zoshine.zzg.base.BaseResponse;
import com.zoshine.zzg.pojo.PrisonerBasic;
import com.zoshine.zzg.respons.AppResponse;
import com.zoshine.zzg.service.PrisonerBasicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**外网犯人基本信息控制层
 * @author 田沛凌
 * @time 2017/9/7 16:08
 */
@RestController
@RequestMapping(value = "prisonerBasic",method = RequestMethod.POST)
public class PrisonerBasicController {

    private PrisonerBasicService prisonerBasicService;
    @Autowired
    public void setPrisonerBasicService(PrisonerBasicService prisonerBasicService) {
        this.prisonerBasicService = prisonerBasicService;
    }

    /**外网
     * 获取犯人基本信息列表
     * @param prisonerBasic；
     * @return 犯人基本信息
     */
    @RequestMapping("listPrisonerBasic")
    public BaseResponse listPrisonerBasic(PrisonerBasic prisonerBasic){
        List<PrisonerBasic> list = prisonerBasicService.list(prisonerBasic);
        return new AppResponse(list);
    }

    @RequestMapping("getPrisonerBasic")
    public BaseResponse getPrisonerBasic(Long id){
        PrisonerBasic prisonerBasic = prisonerBasicService.get(id);
        return new AppResponse(prisonerBasic);
    }

}
